﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.ComponentModel.Composition;
using Mef4Wcf.Mef;

namespace Mef4Wcf
{
    [Export(typeof(IUserService))]
    [MefBehavior]
    public class UserService : IUserService
    {
        [Import(typeof(ILogService))]
        private ILogService _logService;

        public User GetSampleUser()
        {
            User user = new User
            {
                UserName = "thangit",
                Email = "thangit@yahoo.com",
                FullName = "Tran Phuc Thang"
            };


            _logService.Log(string.Format("User {0} has been created successfully", user.FullName));

            return user;
        }
    }
}
